[XEND] Fix fallback and error path for domain destruction by domid,
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 8 Aug 2006 09:03:30 +0000 (10:03 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 8 Aug 2006 09:03:30 +0000 (10:03 +0100)
or of non-existent domain.

I saw the following error message. (A domain of domain name XXX does
not exist.)

# xm list
Name                              ID Mem(MiB) VCPUs State  Time(s)
Domain-0                           0     1019     2 r-----    29.8
# xm destroy XXX
Error: an integer is required

This patch fixes it to print the following error message.

# xm list
Name                              ID Mem(MiB) VCPUs State  Time(s)
Domain-0                           0     1019     2 r-----    35.8
# xm destroy XXX
Error: the domain 'XXX' does not exist.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
tools/python/xen/xend/XendDomain.py

index 94620c3a9c2e7bcf29e70aa90e5a189aeca18772..52cca550d440b542d256b40c5812ba2f4b88a1a0 100644 (file)
@@ -402,9 +402,9 @@ class XendDomain:
             val = dominfo.destroy()
         else:
             try:
-                val = xc.domain_destroy(domid)
+                val = xc.domain_destroy(int(domid))
             except Exception, ex:
-                raise XendError(str(ex))
+                raise XendInvalidDomain(str(domid))
         return val       
 
     def domain_migrate(self, domid, dst, live=False, resource=0, port=0):